package org.mbds.wolf.tsm;

import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.IServiceEvents;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.SSLConnection;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.elements.OperationResult;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.CAInfoBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.CAInfoCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.CCCMCertificatesManagementBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.CardContentManagementBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DelegatedManagementBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DeviceApplicationBindingBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DeviceApplicationBindingCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DeviceApplicationLifeCycleNotificationBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DeviceApplicationManagementBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DeviceApplicationManagementCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.DeviceInfoBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.GlobalEligibilityInfoBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.GlobalServiceManagementBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.GlobalServiceManagementCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.MobileSubscriptionInfoBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.MobileSubscriptionLifeCycleNotificationBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.SCWSManagementBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.SCWSManagementCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.SEAuditBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.SEAuditCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.SEInfoBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.SELifeCycleNotificationBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.ScriptSendingBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.ScriptSendingCallBackBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.ServiceEnvironmentChangeNotificationBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.soapws.ServiceLifeCycleNotificationBinding;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.*;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.BeginConversationResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.BindDeviceApplicationToSEApplicationResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.CheckGlobalEligibilityResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.CheckMobileSubscriptionEligibilityResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.DeclareServiceInstanceReferenceResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.DeployServiceResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.EnrollSSDOwnerCertificateResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.ExchangeServiceDataResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GenerateDMTokenResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetApplicationOrELFStatusResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetCAInformationResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetDeviceCapabilityProfileIdResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetMobileSubscriptionAlternateIdentifierResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetSECapabilityProfileIdResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetServiceInstanceReferenceDescriptorResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.GetServiceStateResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.LoadDeviceApplicationResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.LoadSCWSServicePortalResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.LookupServiceInstanceReferenceResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.SECommandsGenerationAndRemoteExecutionResponseType;
import org.mbds.wolf.tsm.gp.systems.messaging2_1_0.ksoap2.services.types.requests.responses.UpgradeServiceResponseType;

public class GpTsmController {

	private String url;

	/**
	 * constructor
	 * 
	 * @param url
	 */
	public GpTsmController(String serverUrl) {
		this.url = serverUrl;
	}

	/**
	 * setServerUrl
	 * 
	 * @param url
	 */
	public void setServerUrl(String url) {
		this.url = url;
	}

	/**
	 * getServerUrl
	 * 
	 * @return
	 */

	public String getServerUrl() {
		return url;
	}

	/**
	 * getWSurl
	 * 
	 * @param serverUrl
	 * @param binderName
	 * @return
	 */
	public static String getWSurl(String serverUrl, String binderName) {
		if (serverUrl.endsWith("/") || serverUrl.endsWith("\\"))
			return serverUrl + binderName;
		else if (serverUrl.contains("\\"))
			return serverUrl + "\\" + binderName;
		else
			return serverUrl + "/" + binderName;
	}

	/**
	 * checkGlobalEligibility
	 * 
	 * @param callback
	 * @param req
	 */
	public void checkGlobalEligibility(final IServiceEvents callback,
			final CheckGlobalEligibilityRequestType req) {
		final GlobalEligibilityInfoBinding bind = new GlobalEligibilityInfoBinding(
				callback, getWSurl(url,
						GlobalEligibilityInfoBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<CheckGlobalEligibilityResponseType> res = new OperationResult<CheckGlobalEligibilityResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					SSLConnection.allowAllSSL();
					res.Result = bind.CheckGlobalEligibility(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetCAInformation
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetCAInformation(final IServiceEvents callback,
			final GetCAInformationRequestType req) {
		final CAInfoBinding bind = new CAInfoBinding(callback, getWSurl(url,
				CAInfoBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetCAInformationResponseType> res = new OperationResult<GetCAInformationResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GetCAInformation(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * AuditCAInformation // TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void AuditCAInformation(IServiceEvents callback,
//			AuditCAInformationRequest req) {
//		CAInfoBinding bind = new CAInfoBinding(callback, getWSurl(url,
//				CAInfoBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				OperationResult<AuditCAInformationRequest> res = new OperationResult<AuditCAInformationRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					res.Result = bind.AuditCAInformationRequest(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}
//
	/**
	 * AuditCAInformation
	 * 
	 * @param callback
	 * @param req
	 */
	public void AuditCAInformation(final IServiceEvents callback,
			final GetCAInformationResponseType req) {
		final CAInfoCallBackBinding bind = new CAInfoCallBackBinding(callback,
				getWSurl(url, CAInfoCallBackBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetCAInformationResponseType> res = new OperationResult<GetCAInformationResponseType>();
				res.MethodName = "AuditCAInformation";
				try {
					bind.AuditCAInformation(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * EnrollSSDOwnerCertificate
	 * 
	 * @param callback
	 * @param req
	 */
	public void EnrollSSDOwnerCertificate(final IServiceEvents callback,
			final EnrollSSDOwnerCertificateRequestType req) {
		final CCCMCertificatesManagementBinding bind = new CCCMCertificatesManagementBinding(
				callback,
				getWSurl(url,
						CCCMCertificatesManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<EnrollSSDOwnerCertificateResponseType> res = new OperationResult<EnrollSSDOwnerCertificateResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.EnrollSSDOwnerCertificate(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GenerateDMToken
	 * 
	 * @param callback
	 * @param req
	 */
	public void GenerateDMToken(final IServiceEvents callback,
			final GenerateDMTokenRequestType req) {
		final DelegatedManagementBinding bind = new DelegatedManagementBinding(
				callback, getWSurl(url,
						DelegatedManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GenerateDMTokenResponseType> res = new OperationResult<GenerateDMTokenResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GenerateDMToken(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * VerifyDMReceipt //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void VerifyDMReceipt(IServiceEvents callback,
//			VerifyDMReceiptRequest req) {
//		DelegatedManagementBinding bind = new DelegatedManagementBinding(
//				callback, getWSurl(url,
//						DelegatedManagementBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<VerifyDMReceiptRequest> res = new OperationResult<VerifyDMReceiptRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					res.Result = bind.VerifyDMReceipt(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * SECommandsGenerationAndRemoteExecution
	 * 
	 * @param callback
	 * @param req
	 */
	public void SECommandsGenerationAndRemoteExecution(final IServiceEvents callback,
			final SECommandsGenerationAndRemoteExecutionRequestType req) {
		final CardContentManagementBinding bind = new CardContentManagementBinding(
				callback, getWSurl(url,
						CardContentManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<SECommandsGenerationAndRemoteExecutionResponseType> res = new OperationResult<SECommandsGenerationAndRemoteExecutionResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.SECommandsGenerationAndRemoteExecution(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * BindDeviceApplicationToSEApplication
	 * 
	 * @param callback
	 * @param req
	 */
	public void BindDeviceApplicationToSEApplication(final IServiceEvents callback,
			final BindDeviceApplicationToSEApplicationRequestType req) {
		final DeviceApplicationBindingBinding bind = new DeviceApplicationBindingBinding(
				callback, getWSurl(url,
						DeviceApplicationBindingBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<BindDeviceApplicationToSEApplicationResponseType> res = new OperationResult<BindDeviceApplicationToSEApplicationResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.BindDeviceApplicationToSEApplication(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * UnbindDeviceApplicationToSEApplication //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void UnbindDeviceApplicationToSEApplication(IServiceEvents callback,
//			UnbindDeviceApplicationToSEApplicationRequest req) {
//		DeviceApplicationBindingBinding bind = new DeviceApplicationBindingBinding(
//				callback, getWSurl(url,
//						DeviceApplicationBindingBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<UnbindDeviceApplicationToSEApplicationRequest> res = new OperationResult<UnbindDeviceApplicationToSEApplicationRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.UnbindDeviceApplicationToSEApplication(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * BindDeviceApplicationToSEApplication
	 * 
	 * @param callback
	 * @param req
	 */
	public void BindDeviceApplicationToSEApplication(final IServiceEvents callback,
			final BindDeviceApplicationToSEApplicationResponseType req) {
		final DeviceApplicationBindingCallBackBinding bind = new DeviceApplicationBindingCallBackBinding(
				callback, getWSurl(url,
						DeviceApplicationBindingCallBackBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<BindDeviceApplicationToSEApplicationResponseType> res = new OperationResult<BindDeviceApplicationToSEApplicationResponseType>();
				res.MethodName = "BindDeviceApplicationToSEApplication";
				try {
					bind.BindDeviceApplicationToSEApplication(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * UnbindDeviceApplicationToSEApplication //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void UnbindDeviceApplicationToSEApplication(IServiceEvents callback,
//			UnbindDeviceApplicationToSEApplicationResponse req) {
//		DeviceApplicationBindingCallBackBinding bind = new DeviceApplicationBindingCallBackBinding(
//				callback, getWSurl(url,
//						DeviceApplicationBindingCallBackBinding.class
//								.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<UnbindDeviceApplicationToSEApplicationResponse> res = new OperationResult<UnbindDeviceApplicationToSEApplicationResponse>();
//				res.MethodName = "UnbindDeviceApplicationToSEApplication";
//				try {
//					bind.UnbindDeviceApplicationToSEApplication(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					res.Result = null;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * HandleActionDoneOnDeviceApplicationNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleActionDoneOnDeviceApplicationNotification(
			final IServiceEvents callback,
			final HandleActionDoneOnDeviceApplicationNotificationRequestType req) {
		final DeviceApplicationLifeCycleNotificationBinding bind = new DeviceApplicationLifeCycleNotificationBinding(
				callback, getWSurl(url,
						DeviceApplicationLifeCycleNotificationBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleActionDoneOnDeviceApplicationNotificationRequestType> res = new OperationResult<HandleActionDoneOnDeviceApplicationNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleActionDoneOnDeviceApplicationNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * LoadDeviceApplication
	 * 
	 * @param callback
	 * @param req
	 */
	public void LoadDeviceApplication(final IServiceEvents callback,
			final LoadDeviceApplicationRequestType req) {
		final DeviceApplicationManagementBinding bind = new DeviceApplicationManagementBinding(
				callback, getWSurl(url,
						DeviceApplicationManagementBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<LoadDeviceApplicationRequestType> res = new OperationResult<LoadDeviceApplicationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.LoadDeviceApplication(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeleteDeviceApplication //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void DeleteDeviceApplication(IServiceEvents callback,
//			DeleteDeviceApplicationRequest req) {
//		DeviceApplicationManagementBinding bind = new DeviceApplicationManagementBinding(
//				callback, getWSurl(url,
//						DeviceApplicationManagementBinding.class
//								.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<DeleteDeviceApplicationRequest> res = new OperationResult<DeleteDeviceApplicationRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.DeleteDeviceApplication(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * LoadDeviceApplication
	 * 
	 * @param callback
	 * @param req
	 */
	public void LoadDeviceApplication(final IServiceEvents callback,
			final LoadDeviceApplicationResponseType req) {
		final DeviceApplicationManagementCallBackBinding bind = new DeviceApplicationManagementCallBackBinding(
				callback, getWSurl(url,
						DeviceApplicationManagementCallBackBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<LoadDeviceApplicationResponseType> res = new OperationResult<LoadDeviceApplicationResponseType>();
				res.MethodName = "LoadDeviceApplication";
				try {
					bind.LoadDeviceApplication(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeleteDeviceApplication //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void DeleteDeviceApplication(IServiceEvents callback,
//			LoadDeviceApplicationResponseType req) {
//		DeviceApplicationManagementCallBackBinding bind = new DeviceApplicationManagementCallBackBinding(
//				callback, getWSurl(url,
//						DeviceApplicationManagementCallBackBinding.class
//								.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<LoadDeviceApplicationResponseType> res = new OperationResult<LoadDeviceApplicationResponseType>();
//				res.MethodName = "DeleteDeviceApplication";
//				try {
//					res.Result = bind.DeleteDeviceApplication(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * GetDeviceCapabilityProfileId
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetDeviceCapabilityProfileId(final IServiceEvents callback,
			final GetDeviceCapabilityProfileIdRequestType req) {
		final DeviceInfoBinding bind = new DeviceInfoBinding(callback, getWSurl(url,
				DeviceInfoBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetDeviceCapabilityProfileIdResponseType> res = new OperationResult<GetDeviceCapabilityProfileIdResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GetDeviceCapabilityProfileId(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * LookupServiceInstanceReference
	 * 
	 * @param callback
	 * @param req
	 */
	public void LookupServiceInstanceReference(final IServiceEvents callback,
			final LookupServiceInstanceReferenceRequestType req) {
		final GlobalServiceManagementBinding bind = new GlobalServiceManagementBinding(
				callback, getWSurl(url,
						GlobalServiceManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<LookupServiceInstanceReferenceResponseType> res = new OperationResult<LookupServiceInstanceReferenceResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.LookupServiceInstanceReference(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeclareServiceInstanceReference
	 * 
	 * @param callback
	 * @param req
	 */
	public void DeclareServiceInstanceReference(final IServiceEvents callback,
			final DeclareServiceInstanceReferenceRequestType req) {
		final GlobalServiceManagementBinding bind = new GlobalServiceManagementBinding(
				callback, getWSurl(url,
						GlobalServiceManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<DeclareServiceInstanceReferenceResponseType> res = new OperationResult<DeclareServiceInstanceReferenceResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.DeclareServiceInstanceReference(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetServiceInstanceReferenceDescriptor
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetServiceInstanceReferenceDescriptor(final IServiceEvents callback,
			final GetServiceInstanceReferenceDescriptorRequestType req) {
		final GlobalServiceManagementBinding bind = new GlobalServiceManagementBinding(
				callback, getWSurl(url,
						GlobalServiceManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetServiceInstanceReferenceDescriptorResponseType> res = new OperationResult<GetServiceInstanceReferenceDescriptorResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GetServiceInstanceReferenceDescriptor(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetServiceState
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetServiceState(final IServiceEvents callback,
			final GetServiceStateRequestType req) {
		final GlobalServiceManagementBinding bind = new GlobalServiceManagementBinding(
				callback, getWSurl(url,
						GlobalServiceManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetServiceStateResponseType> res = new OperationResult<GetServiceStateResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GetServiceState(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeployService
	 * 
	 * @param callback
	 * @param req
	 */
	public void DeployService(final IServiceEvents callback,
			final DeployServiceRequestType req) {
		final GlobalServiceManagementBinding bind = new GlobalServiceManagementBinding(
				callback, getWSurl(url,
						GlobalServiceManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<DeployServiceResponseType> res = new OperationResult<DeployServiceResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.DeployService(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeployService
	 * 
	 * @param callback
	 * @param req
	 */
	public void DeployService(final IServiceEvents callback,
			final DeployServiceResponseType req) {
		final GlobalServiceManagementCallBackBinding bind = new GlobalServiceManagementCallBackBinding(
				callback, getWSurl(url,
						GlobalServiceManagementCallBackBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<LookupServiceInstanceReferenceResponseType> res = new OperationResult<LookupServiceInstanceReferenceResponseType>();
				res.MethodName = "DeployService";
				try {
					bind.DeployService(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeployService
	 * 
	 * @param callback
	 * @param req
	 */
	public void UpgradeService(final IServiceEvents callback,
			final UpgradeServiceResponseType req) {
		final GlobalServiceManagementCallBackBinding bind = new GlobalServiceManagementCallBackBinding(
				callback, getWSurl(url,
						GlobalServiceManagementCallBackBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<UpgradeServiceResponseType> res = new OperationResult<UpgradeServiceResponseType>();
				res.MethodName = "UpgradeService";
				try {
					bind.UpgradeService(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeployService
	 * 
	 * @param callback
	 * @param req
	 */
	public void ExchangeServiceData(final IServiceEvents callback,
			final ExchangeServiceDataResponseType req) {
		final GlobalServiceManagementCallBackBinding bind = new GlobalServiceManagementCallBackBinding(
				callback, getWSurl(url,
						GlobalServiceManagementCallBackBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<ExchangeServiceDataResponseType> res = new OperationResult<ExchangeServiceDataResponseType>();
				res.MethodName = "ExchangeServiceData";
				try {
					bind.ExchangeServiceData(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * SuspendOrResumeService //TODO
	 * 
	 * @param callback
	 * @param req
	 * */
	public void SuspendOrResumeService(final IServiceEvents callback,
			final SuspendOrResumeServiceResponse req) {
		final GlobalServiceManagementCallBackBinding bind = new GlobalServiceManagementCallBackBinding(
				callback, getWSurl(url,
						GlobalServiceManagementCallBackBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<SuspendOrResumeServiceResponse> res = new OperationResult<SuspendOrResumeServiceResponse>();
				res.MethodName = "SuspendOrResumeService";
				try {
					bind.SuspendOrResumeService(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * CheckMobileSubscriptionEligibility
	 * 
	 * @param callback
	 * @param req
	 */
	public void CheckMobileSubscriptionEligibility(final IServiceEvents callback,
			final CheckMobileSubscriptionEligibilityRequestType req) {
		final MobileSubscriptionInfoBinding bind = new MobileSubscriptionInfoBinding(
				callback, getWSurl(url,
						MobileSubscriptionInfoBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<CheckMobileSubscriptionEligibilityResponseType> res = new OperationResult<CheckMobileSubscriptionEligibilityResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.CheckMobileSubscriptionEligibility(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetMobileSubscriptionAlternateIdentifier
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetMobileSubscriptionAlternateIdentifier(
			final IServiceEvents callback,
			final GetMobileSubscriptionAlternateIdentifierRequestType req) {
		final MobileSubscriptionInfoBinding bind = new MobileSubscriptionInfoBinding(
				callback, getWSurl(url,
						MobileSubscriptionInfoBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetMobileSubscriptionAlternateIdentifierResponseType> res = new OperationResult<GetMobileSubscriptionAlternateIdentifierResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GetMobileSubscriptionAlternateIdentifier(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetMobileSubscriptionSEIdentifiers //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void GetMobileSubscriptionSEIdentifiers(IServiceEvents callback,
//			GetMobileSubscriptionSEIdentifiersRequest req) {
//		MobileSubscriptionInfoBinding bind = new MobileSubscriptionInfoBinding(
//				callback, getWSurl(url,
//						MobileSubscriptionInfoBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<GetMobileSubscriptionSEIdentifiersRequest> res = new OperationResult<GetMobileSubscriptionSEIdentifiersRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					res.Result = bind.GetMobileSubscriptionSEIdentifiers(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * HandleMobileSubscriptionIdentifierChangedNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleMobileSubscriptionIdentifierChangedNotification(
			final IServiceEvents callback,
			final HandleMobileSubscriptionIdentifierChangedNotificationRequestType req) {
		final MobileSubscriptionLifeCycleNotificationBinding bind = new MobileSubscriptionLifeCycleNotificationBinding(
				callback, getWSurl(url,
						MobileSubscriptionLifeCycleNotificationBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleMobileSubscriptionIdentifierChangedNotificationRequestType> res = new OperationResult<HandleMobileSubscriptionIdentifierChangedNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleMobileSubscriptionIdentifierChangedNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleMobileSubscriptionStatusChangeNotification //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void HandleMobileSubscriptionStatusChangeNotification(
//			IServiceEvents callback,
//			HandleMobileSubscriptionStatusChangeNotificationRequest req) {
//		MobileSubscriptionLifeCycleNotificationBinding bind = new MobileSubscriptionLifeCycleNotificationBinding(
//				callback, getWSurl(url,
//						MobileSubscriptionLifeCycleNotificationBinding.class
//								.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<HandleMobileSubscriptionStatusChangeNotificationRequest> res = new OperationResult<HandleMobileSubscriptionStatusChangeNotificationRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.HandleMobileSubscriptionStatusChangeNotification(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * BeginConversation
	 * 
	 * @param callback
	 * @param req
	 */
	public void BeginConversation(final IServiceEvents callback,
			final BeginConversationRequestType req) {
		final ScriptSendingBinding bind = new ScriptSendingBinding(callback,
				getWSurl(url, ScriptSendingBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleMobileSubscriptionIdentifierChangedNotificationRequestType> res = new OperationResult<HandleMobileSubscriptionIdentifierChangedNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.BeginConversation(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * SendScript
	 * 
	 * @param callback
	 * @param req
	 */
	public void SendScript(final IServiceEvents callback, final SendScriptRequestType req) {
		final ScriptSendingBinding bind = new ScriptSendingBinding(callback,
				getWSurl(url, ScriptSendingBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<SendScriptRequestType> res = new OperationResult<SendScriptRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.SendScript(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * EndConversation //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void EndConversation(IServiceEvents callback,
//			EndConversationRequest req) {
//		ScriptSendingBinding bind = new ScriptSendingBinding(callback,
//				getWSurl(url, ScriptSendingBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<EndConversationRequest> res = new OperationResult<EndConversationRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.EndConversation(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * BeginConversation
	 * 
	 * @param callback
	 * @param req
	 */
	public void BeginConversation(final IServiceEvents callback,
			final BeginConversationResponseType req) {
		final ScriptSendingCallBackBinding bind = new ScriptSendingCallBackBinding(
				callback, getWSurl(url,
						ScriptSendingCallBackBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<BeginConversationResponseType> res = new OperationResult<BeginConversationResponseType>();
				res.MethodName = "BeginConversation";
				try {
					bind.BeginConversation(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * SendScript //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void SendScript(IServiceEvents callback, SendScriptResponse req) {
//		ScriptSendingCallBackBinding bind = new ScriptSendingCallBackBinding(
//				callback, getWSurl(url,
//						ScriptSendingCallBackBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<SendScriptResponse> res = new OperationResult<SendScriptResponse>();
//				res.MethodName = "SendScript";
//				try {
//					bind.SendScript(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * LoadSCWSServicePortal
	 * 
	 * @param callback
	 * @param req
	 */
	public void LoadSCWSServicePortal(final IServiceEvents callback,
			final LoadSCWSServicePortalRequestType req) {
		final SCWSManagementBinding bind = new SCWSManagementBinding(callback,
				getWSurl(url, SCWSManagementBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<LoadSCWSServicePortalResponseType> res = new OperationResult<LoadSCWSServicePortalResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.LoadSCWSServicePortal(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeleteSCWSServicePortal //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void DeleteSCWSServicePortal(IServiceEvents callback,
//			DeleteSCWSServicePortalRequest req) {
//		SCWSManagementBinding bind = new SCWSManagementBinding(callback,
//				getWSurl(url, SCWSManagementBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<DeleteSCWSServicePortalRequest> res = new OperationResult<DeleteSCWSServicePortalRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.DeleteSCWSServicePortal(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * LoadSCWSServicePortal
	 * 
	 * @param callback
	 * @param req
	 */
	public void LoadSCWSServicePortal(final IServiceEvents callback,
			final LoadSCWSServicePortalResponseType req) {
		final SCWSManagementCallBackBinding bind = new SCWSManagementCallBackBinding(
				callback, getWSurl(url,
						SCWSManagementCallBackBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<LoadSCWSServicePortalResponseType> res = new OperationResult<LoadSCWSServicePortalResponseType>();
				res.MethodName = "LoadSCWSServicePortal";
				try {
					bind.LoadSCWSServicePortal(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * DeleteSCWSServicePortal //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void DeleteSCWSServicePortal(IServiceEvents callback,
//			DeleteSCWSServicePortalResponse req) {
//		SCWSManagementCallBackBinding bind = new SCWSManagementCallBackBinding(
//				callback, getWSurl(url,
//						SCWSManagementCallBackBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<DeleteSCWSServicePortalResponse> res = new OperationResult<DeleteSCWSServicePortalResponse>();
//				res.MethodName = "DeleteSCWSServicePortal";
//				try {
//					bind.DeleteSCWSServicePortal(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * GetApplicationOrELFStatus
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetApplicationOrELFStatus(final IServiceEvents callback,
			final GetApplicationOrELFStatusRequestType req) {
		final SEAuditBinding bind = new SEAuditBinding(callback, getWSurl(url,
				SEAuditBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetApplicationOrELFStatusResponseType> res = new OperationResult<GetApplicationOrELFStatusResponseType>();
				res.MethodName = "GetApplicationOrELFStatus";
				try {
					bind.GetApplicationOrELFStatus(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetSDFreeMemory //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void GetSDFreeMemory(IServiceEvents callback,
//			GetSDFreeMemoryRequest req) {
//		SEAuditBinding bind = new SEAuditBinding(callback, getWSurl(url,
//				SEAuditBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<GetSDFreeMemoryRequest> res = new OperationResult<GetSDFreeMemoryRequest>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.GetSDFreeMemory(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * GetApplicationOrELFStatus
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetApplicationOrELFStatus(final IServiceEvents callback,
			final GetApplicationOrELFStatusResponseType req) {
		final SEAuditCallBackBinding bind = new SEAuditCallBackBinding(callback,
				getWSurl(url, SEAuditCallBackBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetApplicationOrELFStatusResponseType> res = new OperationResult<GetApplicationOrELFStatusResponseType>();
				res.MethodName = "GetApplicationOrELFStatus";
				try {
					bind.GetApplicationOrELFStatus(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetSDFreeMemory //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void GetSDFreeMemory(IServiceEvents callback,
//			GetSDFreeMemoryResponse req) {
//		SEAuditCallBackBinding bind = new SEAuditCallBackBinding(callback,
//				getWSurl(url, SEAuditCallBackBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<GetSDFreeMemoryResponse> res = new OperationResult<GetSDFreeMemoryResponse>();
//				res.MethodName = "GetSDFreeMemory";
//				try {
//					res.Result = bind.GetSDFreeMemory(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * GetSECapabilityProfileId
	 * 
	 * @param callback
	 * @param req
	 */
	public void GetSECapabilityProfileId(final IServiceEvents callback,
			final GetSECapabilityProfileIdRequestType req) {
		final SEInfoBinding bind = new SEInfoBinding(callback, getWSurl(url,
				SEInfoBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<GetSECapabilityProfileIdResponseType> res = new OperationResult<GetSECapabilityProfileIdResponseType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					res.Result = bind.GetSECapabilityProfileId(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * GetSEMobileSubscriptionIdentifier //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void GetSEMobileSubscriptionIdentifier(IServiceEvents callback,
//			GetSEMobileSubscriptionIdentifierRequestType req) {
//		SEInfoBinding bind = new SEInfoBinding(callback, getWSurl(url,
//				SEInfoBinding.class.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<GetSEMobileSubscriptionIdentifierRequestType> res = new OperationResult<GetSEMobileSubscriptionIdentifierRequestType>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					res.Result = bind.GetSEMobileSubscriptionIdentifier(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * HandleSERenewalNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleSERenewalNotification(final IServiceEvents callback,
			final HandleSERenewalNotificationRequestType req) {
		final SELifeCycleNotificationBinding bind = new SELifeCycleNotificationBinding(
				callback, getWSurl(url,
						SELifeCycleNotificationBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleSERenewalNotificationRequestType> res = new OperationResult<HandleSERenewalNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleSERenewalNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleSEDeviceChangedNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleSEDeviceChangedNotification(final IServiceEvents callback,
			final HandleSEDeviceChangedNotificationRequestType req) {
		final SELifeCycleNotificationBinding bind = new SELifeCycleNotificationBinding(
				callback, getWSurl(url,
						SELifeCycleNotificationBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleSEDeviceChangedNotificationRequestType> res = new OperationResult<HandleSEDeviceChangedNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleSEDeviceChangedNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleSEDeviceStatusChangeNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleSEDeviceStatusChangeNotification(final IServiceEvents callback,
			final HandleSEDeviceStatusChangeNotificationRequestType req) {
		final SELifeCycleNotificationBinding bind = new SELifeCycleNotificationBinding(
				callback, getWSurl(url,
						SELifeCycleNotificationBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleSEDeviceStatusChangeNotificationRequestType> res = new OperationResult<HandleSEDeviceStatusChangeNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleSEDeviceStatusChangeNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleSEMobileSubscriptionChangedNotification //TODO
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleSEMobileSubscriptionChangedNotification(
			final IServiceEvents callback,
			final HandleSEMobileSubscriptionChangedNotificationRequestType req) {
		final SELifeCycleNotificationBinding bind = new SELifeCycleNotificationBinding(
				callback, getWSurl(url,
						SELifeCycleNotificationBinding.class.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleSEMobileSubscriptionChangedNotificationRequestType> res = new OperationResult<HandleSEMobileSubscriptionChangedNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleSEMobileSubscriptionChangedNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleSEStatusChangeNotification //TODO
	 * 
	 * @param callback
	 * @param req
 */
public void HandleSEStatusChangeNotification(final IServiceEvents callback,
		final HandleSEStatusChangeNotificationRequestType req) {
	final SELifeCycleNotificationBinding bind = new SELifeCycleNotificationBinding(
			callback, getWSurl(url,
					SELifeCycleNotificationBinding.class.getSimpleName()));
	Thread t = new Thread(new Runnable() {
		public void run() {
			callback.Starting();
			OperationResult<HandleSEStatusChangeNotificationRequestType> res = new OperationResult<HandleSEStatusChangeNotificationRequestType>();
			res.MethodName = req.FunctionCallIdentifier;
			try {
				bind.HandleSEStatusChangeNotification(req);
			} catch (Exception e) {
				res.Exception = e;
				e.printStackTrace();
			}
			callback.Completed(res);
		}
	});
	t.start();
}

	/**
	 * HandleServiceEnvironmentChangeNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleServiceEnvironmentChangeNotification(
			final IServiceEvents callback,
			final HandleServiceEnvironmentChangeNotificationRequestType req) {
		final ServiceEnvironmentChangeNotificationBinding bind = new ServiceEnvironmentChangeNotificationBinding(
				callback, getWSurl(url,
						ServiceEnvironmentChangeNotificationBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleServiceEnvironmentChangeNotificationRequestType> res = new OperationResult<HandleServiceEnvironmentChangeNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleServiceEnvironmentChangeNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleActionDoneOnServiceNotification //TODO
	 * 
	 * @param callback
	 * @param req
	 */
//	public void HandleActionDoneOnServiceNotification(IServiceEvents callback,
//			HandleActionDoneOnServiceNotificationRequestType req) {
//		ServiceEnvironmentChangeNotificationBinding bind = new ServiceEnvironmentChangeNotificationBinding(
//				callback, getWSurl(url,
//						ServiceEnvironmentChangeNotificationBinding.class
//								.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<HandleActionDoneOnServiceNotificationRequestType> res = new OperationResult<HandleActionDoneOnServiceNotificationRequestType>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					res.Result = bind
//							.HandleActionDoneOnServiceNotification(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

	/**
	 * HandleStartServiceStateChangeNotification
	 * 
	 * @param callback
	 * @param req
	 */
	public void HandleStartServiceStateChangeNotification(
			final IServiceEvents callback,
			final HandleStartServiceStateChangeNotificationRequestType req) {
		final ServiceLifeCycleNotificationBinding bind = new ServiceLifeCycleNotificationBinding(
				callback, getWSurl(url,
						ServiceLifeCycleNotificationBinding.class
								.getSimpleName()));
		Thread t = new Thread(new Runnable() {
			public void run() {
				callback.Starting();
				OperationResult<HandleStartServiceStateChangeNotificationRequestType> res = new OperationResult<HandleStartServiceStateChangeNotificationRequestType>();
				res.MethodName = req.FunctionCallIdentifier;
				try {
					bind.HandleStartServiceStateChangeNotification(req);
				} catch (Exception e) {
					res.Exception = e;
					e.printStackTrace();
				}
				callback.Completed(res);
			}
		});
		t.start();
	}

	/**
	 * HandleEndServiceStateChangeNotification //TODO
	 * 
	 * @param <T>
	 * @param callback
	 * @param req
	 */
//	public void HandleEndServiceStateChangeNotification(
//			IServiceEvents callback,
//			HandleEndServiceStateChangeNotificationRequestType req) {
//		ServiceLifeCycleNotificationBinding bind = new ServiceLifeCycleNotificationBinding(
//				callback, getWSurl(url,
//						ServiceLifeCycleNotificationBinding.class
//								.getSimpleName()));
//		Thread t = new Thread(new Runnable() {
//			public void run() {
//				callback.Starting();
//				OperationResult<HandleEndServiceStateChangeNotificationRequestType> res = new OperationResult<HandleEndServiceStateChangeNotificationRequestType>();
//				res.MethodName = req.FunctionCallIdentifier;
//				try {
//					bind.HandleEndServiceStateChangeNotification(req);
//				} catch (Exception e) {
//					res.Exception = e;
//					e.printStackTrace();
//				}
//				callback.Completed(res);
//			}
//		});
//		t.start();
//	}

}
